package com.hqj.zuul.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/tc")
public class TestController {

    @Autowired
    private RestTemplate rt;

    private final static String PATH_NAME = "http://hqj-eureka-client-8001:8001";
    @RequestMapping("/t1")
    public String test1(){
        String url = PATH_NAME + "/tc/t1?name=zhonghua";
        String str = rt.getForObject(url,String.class);
        return str;
    }

}
